﻿<?php get_header(); ?>
<?php get_sidebar(); ?>
	<div id="content">

		<?php if (have_posts()) : ?>

	   <?php $post = $posts[0]; // Hack. Set $post so that the_date() works.
			 $mycat_ID=get_query_var('cat');
			 $mycat=single_cat_title("", false);
		if($mycat=="small" || $mycat=="medium" || $mycat=="large" || $mycat=="xlarge"){ ?>
        <br />
    <table width="320" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
  <tr>
            <td width="108" height="25" rowspan="2" background="images/post-title-bg.gif" bgcolor="#FFFFFF"><div align="right"><span class="tag-xbig"><?php echo substr(strtoupper($mycat),0,1); ?></span></div></td>
      <td height="25"><span class="tag"><?php echo strtoupper($mycat); ?></span></td>
  </tr>
          <tr>
            <td height="25"><span class="tag2"><?php echo category_description($mycat_ID); ?></span></td>
          </tr>
        </table>
	<?php }else {?>
<br />
		<table width="320" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
  <tr>
  
    <td height="50" background="images/post-title-bg.gif" bgcolor="#FFFFFF"><span class="tag-xbig"><?php echo single_cat_title(); ?></span></td>
  </tr>
  <tr>
    <td height="35"><span class="tag2"><?php echo category_description($mycat_ID); ?></span></td>
  </tr>
</table>
  
		
 	  <?php /* If this is a daily archive */ } ?>
	  <?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
        <!---->
        <table width="320" border="0" cellspacing="1" bgcolor="#000000">
          <?php $weekday_color = '#000000';
			  $weekday_text = '幾';
			  $weekday=get_the_time(w);
		switch ($weekday){
			case '0':
				$weekday_color = '#990000';
				$weekday_text = '日';
				break;
			case '1':
				$weekday_color = '#000000';
				$weekday_text = '壹';
				break;			
			case '2':
				$weekday_color = '#000000';
				$weekday_text = '貳';			
				break;			
			case '3':
				$weekday_color = '#000000';
				$weekday_text = '參';
				break;			
			case '4':
				$weekday_color = '#000000';
				$weekday_text = '肆';				
				break;			
			case '5':
				$weekday_color = '#000000';
				$weekday_text = '伍';
				break;			
			case '6':
				$weekday_color = '#006600';
				$weekday_text = '陸';
				break;				
		}
		?>
          <tr align="center" valign="middle">
            <td width="20" height="50" rowspan="2" align="center" bgcolor="#FFFFFF"><img src="images/time.gif" alt="time" width="20" height="50" align="bottom" /></td>
            <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">月</td>
            <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">日</td>
            <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">年</td>
            <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">時</td>
            <td height="10" align="right" bgcolor="#FFFFFF" class="posttimetag">分</td>
            <td align="right" bgcolor="#000000" class="posttimetag"><div style="color:#FFFFFF">
                <?php the_time('W'); ?>/<?php the_time('D'); ?>
            </div></td>
          </tr>
          <tr align="center" valign="middle" bgcolor="#000000">
            <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('m'); ?></td>
            <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('d'); ?>
                </span></td>
            <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('y'); ?>
                </span></td>
            <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('H'); ?>
                </span></td>
            <td width="20" height="40" bgcolor="#FFFFFF" class="post-time"><?php the_time('i'); ?>
                </span></td>
            <td align="right" bgcolor="<?php echo($weekday_color); ?>" class="post-time-day"><?php echo($weekday_text) ?></td>
          </tr>
        </table>
        <table width="450" border="0" cellspacing="1" bgcolor="#000000">
          <tr>
            <td width="20" height="50" valign="middle" bgcolor="#FFFFFF"><img src="images/title.gif" alt="title" width="20" height="50" align="bottom" /> </td>
            <td width="430" valign="middle" background="images/post-title-bg.gif" bgcolor="#FFFFFF"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_permalink(); ?>"><span class="post-title">
              <?php the_title(); ?>
            </span></a></td>
          </tr>
        </table>
         <table width="450" border="0" cellspacing="1" bgcolor="#000000">
<tr>
    <td width="20" height="50" rowspan="2" bgcolor="#FFFFFF"><img src="images/info.gif" alt="title" width="20" height="50" align="bottom" /></td>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/people_pix.png" alt="" /></div></td>
    <td width="146" bgcolor="#FFFFFF"><span class="postmetadata-big">
      <?php the_author_posts_link('namefl'); ?>
      <?php edit_post_link('edit', ' &#187 ', ''); ?><?php if(function_exists('the_views')) {' | '. the_views(); } ?>
    </span></td>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/catagory_pix.png" alt="類" /></div></td>
    <td bgcolor="#FFFFFF"><span class="postmetadata">
      <?php the_category(' | ') ?>
    </span></td>
</tr>
  <tr>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/comments_pix.png" alt="論" /></div></td>
    <td bgcolor="#FFFFFF"><span class="postmetadata-big">
      <?php comments_popup_link('請說 &#187 ', '留言(1)', '留言(%)'); ?>
    </span></td>
    <td width="25" height="25" bgcolor="#FFFFFF"><div align="center"><img src="images/tags_pix.png" alt="別" /></div></td>
    <td bgcolor="#FFFFFF"><span class="postmetadata">
      <?php the_tags('',' | ',''); ?>
    </span></td>
  </tr>
  </table>
    <!---->

			<div class="entry">
          
	<?php the_content('Read More','TRUE',''); ?>
            
			  <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                 
			</div>

		</div>

		<?php endwhile; ?>


<?php endif; ?>
		<?php get_footer(); ?>
	</div>

